﻿using System;
using System.Runtime.Serialization;
using TheVerge.Base.Models;

namespace TheVerge.Base {
	[DataContract]
	public class Entry : IEntry {

		[DataMember(Name="id")]
		public int Id { get; set; }

		[DataMember(Name = "published_on")]
		public string PublishedOnStr { get; set; }

		public DateTime PublishedOn { get { return DateTime.Parse(PublishedOnStr); } }

		[DataMember(Name="title")]
		public string Title { get; set; }

		[DataMember(Name = "url")]
		public string Url { get; set; }

		public override string ToString() { return string.Format("{0}:{1}", Id, Title); }
	}

    public interface IEntry
    {
        int Id { get; }
    }
}
